import request from '@/utils/request'
import type { PageParam, ResponseData } from '../commonType'

enum API {
  All_URL = '/t-brand-info/getAll',
  PAGE_URL = '/t-brand-info/getPage',
  ADD_URL = '/t-brand-info/add',
  EDIT_URL = '/t-brand-info/update',
  DELETE_URL = '/t-brand-info/delete',
}

export function brandGetAll() {
  return request.get<any, ResponseData>(API.All_URL)
}

export function brandGetPage(data: PageParam) {
  return request.get<any, ResponseData>(API.PAGE_URL, { params: data })
}

export function brandAdd(data: any) {
  return request.post<any, ResponseData>(API.ADD_URL, data)
}

export function brandEdit(data: any) {
  return request.put<any, ResponseData>(API.EDIT_URL, data)
}

export function brandDelete(id: string | number) {
  return request.post<any, ResponseData>(`${API.DELETE_URL}/${id}`)
}
